package com.hmall.user.interceptor;

import com.hmall.user.util.UserUtil;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class MyFeignInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate requestTemplate) {
        Long userId = UserUtil.getUserId();
        log.info("userId={}",userId);
        requestTemplate.header("authorization","2");
    }
}
